package array

func reverseList(head *ListNode) *ListNode {
	var temp *ListNode
	var cur *ListNode = head
	var pre *ListNode
	for cur != nil {
		temp = cur.Next
		cur.Next = pre
		pre = cur
		cur = temp
	}
	return pre
}

type ListNode struct {
	Val  int
	Next *ListNode
}
